package demo1;

public class Demo1
{
    public static class RunnableTask implements Runnable
    {
        @Override
        public void run()
        {
            System.out.println(Thread.currentThread().getName());
        }
    }

    public static void main(String[] args)
    {
        new Thread(new RunnableTask()).start();
        new Thread(new RunnableTask()).start();
    }

    public static class MyThread extends Thread
    {
        @Override
        public void run()
        {
            System.out.println(getName());
        }
    }
}
